package com.cf.game.stage;

import com.cf.core.player.Player;
import com.cf.core.player.UserInfo;
import com.cf.core.player.UserInfoService;
import com.cf.game.service.util.BeanFactoryUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * game-server-RobotPlayer
 * 机器人玩家
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/5/8 下午 04:54
 */
@Slf4j
public class RobotPlayer implements Player {

    private UserInfo defaultUserInfo;

    public RobotPlayer() {
        UserInfo userInfo = BeanFactoryUtil.getBean(UserInfoService.class).virtualUserInfo();
        defaultUserInfo = userInfo;
    }

    @Override
    public Integer getId() {
        return defaultUserInfo.getUserId();
    }

    @Override
    public String getName() {
        return defaultUserInfo.getName();
    }

    @Override
    public String getHead() {
        return defaultUserInfo.getHead();
    }

    @Override
    public String getToken() {
        return defaultUserInfo.getToken();
    }

    @Override
    public void sendMessage(String message) {
        log.info("机器人不需要发送消息");
    }

    @Override
    public void sendMessage(Object message) {
        log.info("机器人不需要发送消息");
    }

    @Override
    public String getLocation() {
        return "上海";
    }

    @Override
    public void clean() {
        log.info("机器人无session清理！");
    }
}
